<template>
  <div :style="{ color: this.fontColor }">
    <div @click="handleClick"><slot></slot></div>
  </div>
</template>
<style lang="less" scoped></style>
<script>
export default {
  name: "SlotItem",
  props: {
    fontColor: {
      type: String,
      default: "black",
    },
    itemKey: {
      type: [String, Number],
      default: 1,
    },
  },
  data() {
    return {
      count: 0,
    };
  },
  methods: {
    handleClick() {
      this.count++;
      this.$store.commit("setCount", { no: this.itemKey, val: this.count });
    },
  },
};
</script>
